//
//  YLWebViewController.m
//  YLFinanceService
//
//  Created by she1323 on 2017/10/16.
//  Copyright © 2017年 she1323. All rights reserved.
//

#import "YLWebViewController.h"
#import <WebKit/WebKit.h>
#import <Masonry.h>
@interface YLWebViewController ()
@property (nonatomic, weak) WKWebView *webView;
@end

@implementation YLWebViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    WKWebView *webView = [[WKWebView alloc] initWithFrame:CGRectZero];

    [self.view addSubview:webView];
    __weak typeof(self) weakSelf = self;
    [webView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.right.bottom.left.mas_equalTo(weakSelf.view);
    }];
    _webView = webView;
    
}

- (void)setContentHtml:(NSString *)contentHtml
{
    _contentHtml = contentHtml;
    if ([self.contentHtml isKindOfClass:[NSString class]]) {
        [_webView loadHTMLString:self.contentHtml baseURL:nil];
    }
    
}

- (void)dealloc
{
    [[NSURLCache sharedURLCache] removeAllCachedResponses];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
